package com.panshi.api;

import com.panshi.po.Article;
import com.panshi.po.Search;
import com.panshi.vo.Result;
import com.panshi.vo.SearchPageVO;
import com.panshi.vo.SearchQueryVO;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Set;

@FeignClient(name="hasbei-search",path = "search-api")
@Component
@Api(tags = "搜索接口")
public interface SearchApi {

    /**
     * 搜索
     * @param searchQueryVO
     * @return
     */
    @PostMapping("/search")
    Result<Set<Search>> search(@RequestBody SearchQueryVO searchQueryVO);

    /**
     * 分页
     * @return
     */
    @PostMapping("/paging")
    Result<SearchPageVO> paging(@RequestBody SearchQueryVO searchQueryVO);

    /**
     * 热搜
     * @return
     */
    @GetMapping("/hotSearch")
    Result<Set<Article>> hotSearch();
}
